#
# JobThread.py
# (c) 2008 Will Baker.
#

from threading import Thread

class JobThread(Thread):
    def __init__( self, name, queue ):
        Thread.__init__( self )
        self.name = name
        self.queue = queue
        
    def run( self ):
        """
        Start the job.
        """
        job = self.queue.next_job()
        
        while job != None:
            try:
                job.start()
            except Exception, e:
                print e
            finally:
                job = self.queue.next_job()
